#include "Global.h"
#include <iostream>
#include <string>

using namespace std;

char* reverseComplement(char* source, char* dest)
{
	GUINT32 len = strlen(source);
	for (GUINT32 i = 0; i < len; ++i) {
		char ch = source[len - i - 1];
		switch(ch) {
		case 'A': ch = 'T'; break;
		case 'G': ch = 'C'; break;
		case 'C': ch = 'G'; break;
		case 'T': ch = 'A'; break;
		default: cout << "undefined code " << len - i - 1 << endl; exit(1);
		}
		dest[i] = ch;
	}
	dest[len] = '\0';
	return dest;
}